# Contributor: Douglas Haber <me@douglashaber.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=pure-ftpd
pkgver=1.0.51
pkgrel=1
pkgdesc="Pure FTPD FTP daemon"
url="https://pureftpd.org/"
arch="all"
license="ISC"
makedepends="openssl-dev>3"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://download.pureftpd.org/pub/pure-ftpd/releases/pure-ftpd-$pkgver.tar.gz
	pure-ftpd.initd
	pure-ftpd.confd
	minimal.patch
	"

# secfixes:
#   1.0.49-r1:
#     - CVE-2020-9274
#     - CVE-2020-9365

build() {
	./configure \
		--prefix=/usr \
		--with-minimal \
		--with-throttling  \
		--with-puredb \
		--with-tls
	make
}

package() {
	make DESTDIR="$pkgdir" install
	install -Dm755 ../$pkgname.initd \
		"$pkgdir/etc/init.d/$pkgname"

	install -Dm644 ../$pkgname.confd \
		"$pkgdir/etc/conf.d/$pkgname"
}

sha512sums="
8048e41cbe3d982807f3e4594776c65b0918d8782389b40f38a4505facad8bb4e2e62b042c69ad6fff637ea53ec1bd7839577b0e5d70c00f7261c764c34f579c  pure-ftpd-1.0.51.tar.gz
fde2e979410779cc0044e1190b88fe2f0956166b68e2d7fb94520bc0803a3ec85814f66e09a7fdae4ebead872c9a48d973cf7ef3d2818f2298b22ac629cfcf25  pure-ftpd.initd
a5cc8e59178a5d0f7b5909d09009ef6ace1f8e6874bd733e21bc30f4899447e70b020a0369077132751ceb28afa971588efedcce3dea83e9b043b1545caf3393  pure-ftpd.confd
8d05f6e61f5849d59843b6117d2f0dac25a543298f78e982296177ef464f1c7db12b9450a0b31553906600e03b38218f75c0e690cb370e91a562b38fb4f1adbe  minimal.patch
"
